//
//  UIViewController+LogIn.m
//  duochongApp
//
//  Created by 唐开江 on 15/5/4.
//  Copyright (c) 2015年 陈祖峰. All rights reserved.
//

#import "UIViewController+LogIn.h"
#import "KZLogVC.h"
@implementation UIViewController (LogIn)

- (BOOL)isLogin
{
    
    
    NSDictionary *userDict = kzUserInfo;
    

    NSString * userId = userDict[@"userId"];

    
    if (userId==nil||[userId isEqualToString:@"0"]) {
        
        KZLogVC *login = [[KZLogVC alloc]init];
        UINavigationController * naviVC = [[UINavigationController alloc]initWithRootViewController:login];
        
        login.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"关闭" style:UIBarButtonItemStylePlain target:self action:@selector(returnClick)];
        
        
        [self presentViewController:naviVC animated:YES completion:nil];
        return NO;
    }else
        return YES;
    

}


- (void)returnClick
{

    [self dismissViewControllerAnimated:YES completion:nil];

}


@end
